package com.sinosoft.data1;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sinosoft.product.ZywxImage1;

@Service
public class ZywxImage1ManagerImpl implements ZywxImage1Manager{

	
	@Autowired
	ZywxImage1Dao zdao;
	

	public void setZdao(ZywxImage1Dao zdao) {
		this.zdao = zdao;
	}
	
	
	public int getPagesize(ZywxImage1 zywx1) {
		StringBuffer sql = new StringBuffer();
		sql.append("where 1 = 1");
		String sensorid = zywx1.getSensorid();
		if(null == sensorid ){
			
		}else{
			if(!"".equalsIgnoreCase(sensorid)){
				sql.append("and sensorid like " + "'%" + sensorid + "%'");
			}
		}
		return zdao.getPageSize(sql.toString());
	}

	public List<ZywxImage1> getZywxImage1() {
		// TODO Auto-generated method stub
		return zdao.getZywxImage1();
	}

	

	public ZywxImage1 getZywxImage1BySensorid(String sensorid) {
		
		ZywxImage1 zywx1 = zdao.getZywxImage1BySensorid(sensorid);
		return zywx1;
	}

	public List<ZywxImage1> getZywxImage1List(int pageFirst, int pageSize) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<ZywxImage1> getZywxImage1List(int pageFirst, int pageSize,
			ZywxImage1 zywx1) {
		if(null == zywx1.getSensorid()){
			return zdao.getZywxImage1List(pageFirst, pageSize);
		}else{
			return zdao.getZywxImage1List(pageFirst, pageSize, zywx1); 
		}
		
	}

	
	public ZywxImage1 saveZywxImage1(ZywxImage1 zywx1) {
		// TODO Auto-generated method stub
		return zdao.saveZywxImage1(zywx1); 
	}

	public ZywxImage1 getZywxImage1ById(String productid) {
		// TODO Auto-generated method stub
		return zdao.getZywxImage1ById(productid);
	}

	public void removeZywxImage1(String productid) {
		// TODO Auto-generated method stub
		zdao.removeZywxImage1(productid);
	}

	

	

}
